package com.uzai.console.web.report;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.dto.device.DeviceQuery;
import com.uzai.console.dto.report.RealTimeOverviewReportDto;
import com.uzai.console.service.device.DeviceService;
import com.uzai.console.service.report.RealTimeOverviewReportService;
import com.uzai.console.vo.device.DeviceInfoVo;
import com.uzai.console.vo.report.RealTimeOverviewResultVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 实时总览
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "实时总览",tags = "数据报表|实时总览")
@ApiSort(50)
@RestController
public class RealTimeOverviewReportController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(RealTimeOverviewReportController.class);

    @Autowired
    private DeviceService deviceService;
    @Autowired
    private RealTimeOverviewReportService realTimeOverviewReportService;

    @ApiOperation(value = "查询机器人下拉列表", notes = "查询机器人下拉列表", response = DeviceInfoVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/report/realTimeOverview/findDeviceList")
    public Object findDeviceList(@RequestBody DeviceQuery deviceQuery) {
        deviceQuery.setMerId(getLoginInfo().getMerId());
        return deviceService.findDeviceList(deviceQuery);
    }

    @ApiOperation(value = "统计实时总览报表（废弃不用）", notes = "统计实时总览报表（废弃不用", response = RealTimeOverviewResultVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/report/realTimeOverviewReport")
    public Object realTimeOverviewReport(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewReportService.realTimeOverviewReport(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "统计实时总览报表-利润佣金（实时总览统计页面第一块）", notes = "统计实时总览报表-利润佣金（统计页面第一块）", response = RealTimeOverviewResultVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/report/realTimeOverviewReport_commission")
    public Object realTimeOverviewReport_commission(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewReportService.realTimeOverviewReport_commission(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "统计实时总览报表-进粉佣金（实时总览统计页面第二块）", notes = "统计实时总览报表-进粉佣金（统计页面第二块）", response = RealTimeOverviewResultVo.class)
    @ApiOperationSupport(order = 3)
    @PostMapping("/report/realTimeOverviewReport_addFans")
    public Object realTimeOverviewReport_addFans(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewReportService.realTimeOverviewReport_addFans(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "统计实时总览报表-提现数据（实时总览统计页面第三块）", notes = "统计实时总览报表-提现数据（统计页面第三块）", response = RealTimeOverviewResultVo.class)
    @ApiOperationSupport(order = 4)
    @PostMapping("/report/realTimeOverviewReport_takeBal")
    public Object realTimeOverviewReport_takeBal(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewReportService.realTimeOverviewReport_takeBal(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "统计实时总览报表-推广支出（实时总览统计页面第四块）", notes = "统计实时总览报表-推广支出（统计页面第四块）", response = RealTimeOverviewResultVo.class)
    @ApiOperationSupport(order = 5)
    @PostMapping("/report/realTimeOverviewReport_expend")
    public Object realTimeOverviewReport_expend(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewReportService.realTimeOverviewReport_expend(realTimeOverviewReportDto);
    }

}
